package org.vaadin.nf4v.core.navigation.resource;

import com.vaadin.terminal.ExternalResource;
import org.vaadin.nf4v.core.NavigableApplication;
import org.vaadin.nf4v.core.navigation.target.NavigationTarget;

/**
 * Vaadin resource to context.
 * Used to generate link to context home page.
 */
public class ContextResource extends ExternalResource {

    /**
     * Creates vaadin resource.
     * Represents link to target context.
     *
     * @param target navigation target
     */
    public ContextResource(NavigationTarget target) {
        super(NavigableApplication.getCurrent().getServletContext() + target.getContext());
    }
}
